CREATE DATABASE  IF NOT EXISTS `lapidb` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `lapidb`;
-- MySQL dump 10.13  Distrib 5.5.16, for Win32 (x86)
--
-- Host: localhost    Database: lapidb
-- ------------------------------------------------------
-- Server version	5.5.23

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `centrodeportivo`
--

DROP TABLE IF EXISTS `centrodeportivo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `centrodeportivo` (
  `ID_CentroDeportivo` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` text,
  `Activo` tinyint(1) DEFAULT NULL,
  `Direccion` varchar(90) DEFAULT NULL,
  `Telefono` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`ID_CentroDeportivo`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `centrodeportivo`
--

LOCK TABLES `centrodeportivo` WRITE;
/*!40000 ALTER TABLE `centrodeportivo` DISABLE KEYS */;
INSERT INTO `centrodeportivo` VALUES (1,'Centro Deportivo 1',1,'Direccion CentroDeportivo 1','953606061'),(2,'Centro Deportivo 2',1,'Direccion CentroDeportivo2','953606062'),(3,'Centro Deportivo3',1,'Direccion CentroDeportivo3','953606063');
/*!40000 ALTER TABLE `centrodeportivo` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `usuario`
--

DROP TABLE IF EXISTS `usuario`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuario` (
  `ID_Usuario` int(11) NOT NULL AUTO_INCREMENT,
  `Nombre` text,
  `Apellido` text,
  `Apellido2` text,
  `DNI` varchar(10) DEFAULT NULL,
  `Usuario` varchar(45) DEFAULT NULL,
  `Password` varchar(45) DEFAULT NULL,
  `Fx_registro` datetime DEFAULT NULL,
  `ID_Permisos` int(11) DEFAULT NULL,
  `Activo` tinyint(1) DEFAULT NULL,
  `Email` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`ID_Usuario`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `usuario`
--

LOCK TABLES `usuario` WRITE;
/*!40000 ALTER TABLE `usuario` DISABLE KEYS */;
INSERT INTO `usuario` VALUES (1,'Fran','Apellido1','Apellido2','05521929C','Admin','Admin','2012-05-11 00:00:00',3,1,'francisco.gamo@gmail.com'),(2,'Fco','Ga','Lo','27047953E','Usu2','Usu2','2001-01-01 00:00:00',1,0,'usu2@test.es'),(6,'Usuario1','ApellidoUsua1','Apellido2Usua1','12242290B','User1','User1','2001-01-01 00:00:00',2,1,'User1@test.es'),(7,'Usuario3','ApellidoUsuario3','Apellido2Usuario3','17468580B','User3','User3','2001-01-01 00:00:00',2,1,'User3@test.es'),(8,'Usuario4','ApellidoUsuario4','Apellido2Usuario4','90127696B','User4','User4','2001-01-01 00:00:00',1,1,'User4@test.es'),(9,'Antonio','Conejero ','Díaz','26252889E','ancodi','paquitocervicales','2001-01-01 00:00:00',1,1,'aconejerodiaz@gmail.com');
/*!40000 ALTER TABLE `usuario` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `deportes`
--

DROP TABLE IF EXISTS `deportes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `deportes` (
  `ID_Deportes` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` text,
  `Activo` tinyint(1) DEFAULT NULL,
  `Color` varchar(7) DEFAULT NULL,
  PRIMARY KEY (`ID_Deportes`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `deportes`
--

LOCK TABLES `deportes` WRITE;
/*!40000 ALTER TABLE `deportes` DISABLE KEYS */;
INSERT INTO `deportes` VALUES (1,'Fútbol',1,'#ffaaff'),(2,'Pádel',1,'#ecff0f'),(3,'Baloncesto',1,'#03ffe1'),(5,'Hockey',1,'#db394c');
/*!40000 ALTER TABLE `deportes` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `reservas`
--

DROP TABLE IF EXISTS `reservas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `reservas` (
  `ID_Reservas` int(11) NOT NULL AUTO_INCREMENT,
  `ID_Usuario` int(11) DEFAULT NULL,
  `ID_DeportesPista` int(11) DEFAULT NULL,
  `Hora_Ini` datetime DEFAULT NULL,
  `Hora_Fin` datetime DEFAULT NULL,
  `Activo` tinyint(1) DEFAULT NULL,
  `Luz` tinyint(1) DEFAULT NULL,
  `Importe` double DEFAULT NULL,
  PRIMARY KEY (`ID_Reservas`),
  KEY `FK_Usuario` (`ID_Usuario`),
  KEY `FK_DeportesPista` (`ID_DeportesPista`),
  CONSTRAINT `FK_DeportesPista` FOREIGN KEY (`ID_DeportesPista`) REFERENCES `deportespista` (`ID_DeportesPista`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_Usuario` FOREIGN KEY (`ID_Usuario`) REFERENCES `usuario` (`ID_Usuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `reservas`
--

LOCK TABLES `reservas` WRITE;
/*!40000 ALTER TABLE `reservas` DISABLE KEYS */;
INSERT INTO `reservas` VALUES (1,1,2,'2012-05-24 09:00:00','2012-05-24 10:00:00',1,0,7.5),(2,1,2,'2012-05-26 20:00:00','2012-05-26 21:00:00',1,0,7.5),(3,1,2,'2012-05-26 10:00:00','2012-05-26 11:00:00',1,0,7.5),(4,1,2,'2012-05-27 10:00:00','2012-05-27 11:00:00',1,0,7.5),(5,8,1,'2012-05-15 05:00:00','2012-05-15 06:00:00',0,1,6),(6,8,1,'2012-05-27 02:00:00','2012-05-27 03:00:00',1,1,6),(7,8,1,'2012-05-27 02:00:00','2012-05-27 03:00:00',1,1,6),(8,8,1,'2012-05-27 03:00:00','2012-05-27 04:00:00',1,1,6),(9,7,1,'2012-05-27 03:00:00','2012-05-27 04:00:00',1,1,6),(10,7,1,'2012-05-27 06:00:00','2012-05-27 07:00:00',1,1,6),(11,7,9,'2012-05-27 02:00:00','2012-05-27 03:00:00',1,1,5),(12,8,9,'2012-05-27 04:00:00','2012-05-27 05:00:00',1,1,5),(13,8,9,'2012-05-27 08:30:00','2012-05-27 09:30:00',1,1,5),(14,8,6,'2012-05-28 08:30:00','2012-05-28 09:30:00',1,1,5),(15,8,6,'2012-05-27 09:30:00','2012-05-27 10:30:00',1,1,5),(16,6,1,'2012-05-28 09:00:00','2012-05-28 10:00:00',1,1,6),(17,6,2,'2012-05-28 11:00:00','2012-05-28 12:00:00',1,1,7.5),(18,6,4,'2012-05-28 10:00:00','2012-05-28 11:00:00',1,1,6),(19,9,2,'2012-06-01 10:00:00','2012-06-01 11:00:00',1,1,7.5);
/*!40000 ALTER TABLE `reservas` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `pista`
--

DROP TABLE IF EXISTS `pista`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pista` (
  `ID_Pista` int(11) NOT NULL AUTO_INCREMENT,
  `ID_CentroDeportivo` int(11) NOT NULL,
  `Descripcion` text,
  `Hora_Ini` datetime DEFAULT NULL,
  `Hora_Fin` datetime DEFAULT NULL,
  `Luz` tinyint(1) DEFAULT NULL,
  `Activo` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`ID_Pista`),
  KEY `FK_CentroDeportivo` (`ID_CentroDeportivo`),
  CONSTRAINT `FK_CentroDeportivo` FOREIGN KEY (`ID_CentroDeportivo`) REFERENCES `centrodeportivo` (`ID_CentroDeportivo`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `pista`
--

LOCK TABLES `pista` WRITE;
/*!40000 ALTER TABLE `pista` DISABLE KEYS */;
INSERT INTO `pista` VALUES (1,1,'Pista 1 CD1','0001-01-01 08:00:00','0001-01-01 11:00:00',1,1),(4,1,'Pista4','2001-01-01 09:00:00','2001-01-01 12:00:00',0,1),(5,1,'PruebaCreado2','2001-01-01 12:30:00','2001-01-01 21:30:00',1,1),(6,1,'PruebaCreado3 CD1','2001-01-01 12:30:00','2001-01-01 13:00:00',0,1),(7,1,'asaassa AAAb','2001-01-01 01:00:00','2001-01-01 01:30:00',1,1),(8,3,'Pista1 CD3','2001-01-01 08:30:00','2001-01-01 22:30:00',1,1),(9,3,'Pista2 CD3','2001-01-01 09:00:00','2001-01-01 23:00:00',0,0),(10,3,'Pista3 CD3','2001-01-01 08:30:00','2001-01-01 18:30:00',0,1);
/*!40000 ALTER TABLE `pista` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `deportespista`
--

DROP TABLE IF EXISTS `deportespista`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `deportespista` (
  `ID_DeportesPista` int(11) NOT NULL AUTO_INCREMENT,
  `ID_Pista` int(11) NOT NULL,
  `ID_Deportes` int(11) NOT NULL,
  `Precio` double DEFAULT NULL,
  `SuplementoLuz` double DEFAULT NULL,
  `Activo` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`ID_DeportesPista`),
  KEY `FK_Deportes` (`ID_Deportes`),
  KEY `FK_Pista` (`ID_Pista`),
  CONSTRAINT `FK_Deportes` FOREIGN KEY (`ID_Deportes`) REFERENCES `deportes` (`ID_Deportes`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `FK_Pista` FOREIGN KEY (`ID_Pista`) REFERENCES `pista` (`ID_Pista`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `deportespista`
--

LOCK TABLES `deportespista` WRITE;
/*!40000 ALTER TABLE `deportespista` DISABLE KEYS */;
INSERT INTO `deportespista` VALUES (1,4,1,6,2.25,1),(2,4,2,7.5,2.5,1),(3,4,5,0,0,0),(4,4,3,6,0,1),(5,1,1,9.56,1.25,1),(6,8,2,5,2,1),(7,9,3,8,0,1),(8,9,5,9,0,1),(9,10,2,5,0,1);
/*!40000 ALTER TABLE `deportespista` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `permisos`
--

DROP TABLE IF EXISTS `permisos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permisos` (
  `ID_Permisos` int(11) NOT NULL AUTO_INCREMENT,
  `Descripcion` text,
  `Activo` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`ID_Permisos`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `permisos`
--

LOCK TABLES `permisos` WRITE;
/*!40000 ALTER TABLE `permisos` DISABLE KEYS */;
INSERT INTO `permisos` VALUES (1,'Usuario',1),(2,'Administrador de Pistas',1),(3,'Administrador Sistema',1);
/*!40000 ALTER TABLE `permisos` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `admincentro`
--

DROP TABLE IF EXISTS `admincentro`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admincentro` (
  `idAdminCentro` int(11) NOT NULL AUTO_INCREMENT,
  `id_usuario` int(11) NOT NULL,
  `id_centrodeportivo` int(11) NOT NULL,
  PRIMARY KEY (`idAdminCentro`),
  KEY `fk_admincentro_centrodeportivo` (`id_centrodeportivo`),
  KEY `fk_admincentro_usuario` (`id_usuario`),
  CONSTRAINT `fk_admincentro_centrodeportivo` FOREIGN KEY (`id_centrodeportivo`) REFERENCES `centrodeportivo` (`ID_CentroDeportivo`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_admincentro_usuario` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`ID_Usuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admincentro`
--

LOCK TABLES `admincentro` WRITE;
/*!40000 ALTER TABLE `admincentro` DISABLE KEYS */;
INSERT INTO `admincentro` VALUES (12,6,1),(13,7,3);
/*!40000 ALTER TABLE `admincentro` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2012-05-27 18:46:54
